package top.wenzz.manage.system.manage.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import top.wenzz.commons.annotation.Query;
import top.wenzz.commons.annotation.Edit;
import top.wenzz.commons.entity.DataEntity;

import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * 系统模块
 * Created by 钟廷员 on 2016/9/14.
 */
@Entity( name = "sys_module" )
@Data
public class SysModule extends DataEntity<SysModule> {
    @Column(length = 50, unique = true, nullable = false)
    @Length(min = 2, max = 50, message = "模块名称长度为2-50")
    @NotBlank(message = "模块名称不能为空")
    @Query(Query.ReadType.LIKE)
    @Edit
    private String name;
}
